//
//  CXLStatusNormalCell.swift
//  weibo1990
//
//  Created by 曹晓龙 on 15/10/22.
//  Copyright © 2015年 曹晓龙. All rights reserved.
//

import UIKit

/// 普通微博数据
class CXLStatusNormalCell: StatusCell {


    /// 单条微博数据视图模型
    override var statusViewModel:StatusViewModel?{
        
        didSet{
            
            //更新配图约束
            let offset = (statusViewModel?.pictureUrls?.count ?? 0) == 0 ? 0 : statusCellMargin
            
            pictureView.snp_updateConstraints { (make) -> Void in
                make.top.equalTo(titleLbl.snp_bottom).offset(offset)
            }
        }
    }
    
    override func setupUI() {
        
        super.setupUI()
        
        //配图界面
        pictureView.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(contentView.snp_left).offset(statusCellMargin)
            make.top.equalTo(titleLbl.snp_bottom).offset(statusCellMargin)
            make.width.equalTo(300)
            make.height.equalTo(90)
        }
        
    }

}
